# Contributor: Chloe Kudryavtsev <toast@toastin.space>
# Maintainer: Chloe Kudryavtsev <toast@toastin.space>
pkgname=watchexec
pkgver=1.14.0
pkgrel=0
pkgdesc='Executes commands in response to file modifications'
url='https://github.com/watchexec/watchexec'
arch='x86_64 x86 armhf armv7 aarch64 ppc64le' # limited by rust/cargo
license='Apache-2.0'
makedepends='cargo'
subpackages="$pkgname-doc
	$pkgname-zsh-completion
	"
source="watchexec-$pkgver.tar.gz::https://github.com/watchexec/watchexec/archive/$pkgver.tar.gz"

export CARGO_HOME="$srcdir"/cargo

build() {
	cargo build \
		--release \
		--verbose
}

check() {
	cargo test --all \
		--release \
		--verbose
}

package() {
	install -Dm755 target/release/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
	install -Dm644 doc/"$pkgname".1 "$pkgdir"/usr/share/man/man1/"$pkgname".1
	install -Dm644 "$builddir"/completions/zsh \
		"$pkgdir"/usr/share/zsh/site-functions/_watchexec
}

sha512sums="e502264aba5b9247f66edce8108bb688b9bce4420ec6b0fd61f32d1d3c3fa781b4582fbd737cfb344a0d59a8eec001091783ff8119643435a277a5490044b8f7  watchexec-1.14.0.tar.gz"
